home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu478.dms / pu478.adf / CONVERT / Convert.doc < prev    next >
Text File  |  1993-09-02  |  7KB  |  172 lines

  1.                          Convert Documentation
  2.  
  3.    Usage
  4.    -----
  5.       Convert may be used from CLI only.
  6.  
  7.       Below is what Convert would output if called with the wrong # of
  8.    arguments or '?' as the first argument.
  9.  
  10.       Usage: Convert # <from unit> [ [to] <to unit> ]
  11.              where # is a number ( possibly 1 ),
  12.              <from unit> is the units to be converted from
  13.              <to unit> is the units to be converted to
  14.              if <to unit> is not supplied, then a list of
  15.              all units of similar kind will be output
  16.       Convert ? produces this list
  17.              See conv.dat (required in the current directory)
  18.              for valid units
  19.              conv.dat is an ASCII file that may be added to
  20.              provided the format is correct (See docs)
  21.  
  22.       Any of the Items or Synonyms below may be used with the conv.dat
  23.    supplied.
  24.  
  25.    Distribution and copyright
  26.    --------------------------
  27.       Convert may be freely copied and distributed as long as no charges
  28.    are made other than to cover the time, copying costs and mailing costs.
  29.    Please don't distribute Convert without its accompanying doc file.
  30.    Archiving and crunching are allowed. I retain the copyright to it(1993).
  31.  
  32.       I assume no responsibility of damage done to your hardware or software
  33.    which the use of Convert may cause. Its use is totally your own
  34.    responsibility.
  35.  
  36.       The above is just for the record. I don't expect Convert to do any
  37.    damage to hardware or software. I have used it for some time with no
  38.    problems.
  39.  
  40.    Personalization
  41.    ---------------
  42.       Adding items to conv.dat ( or making a new one ) requires that you to
  43.    adhere to certain conventions. First, any items that you wish to use
  44.    that appear in Item (below) must be put into conv.dat as the corresponding
  45.    item in synonym. Second, if a new category is created, no item in Item may
  46.    be used alone, as it won't be found ( in the current conv.dat, at least as
  47.    all Items are already used ). When a new category is created, it should
  48.    consist of three lines: the category name( one string [ use '_' if
  49.    necessary] ), a list of unit names and a list of unit numerical
  50.    correspondences. The item names in conv.dat are limited to 29 characters.
  51.    ( Used to be 19, but I ran into weird symptoms and a difficult-to-find
  52.    cause. ) Command-line names may be up to 39 characters long. Up to 24
  53.    items may appear in a category, but they need not be on the same line.
  54.    They must, however be consecutive. ALL the names must appear first, then
  55.    the numbers, which also do not need to be on the same line. As an example
  56.    compare the following with the first 3 lines of the supplied conv.dat.
  57.  
  58. Length
  59. in      ft          yd         cm     m        Km      statute_mi
  60. nautical_mi     pars         light-yr    mil    un      mun  angstrom
  61. x-unit     rod         fathom       furlong
  62. 1   8.333333e-2  2.777777e-2  2.54  2.54e-2  2.54e-6  1.578283e-5
  63. 1.371604e-5  8.235655e-19  2.684858e-18  1e3  2.54e4  2.54e7  2.54e8
  64. 2.54e11  5.050505e-3  1.388888e-2  1.262626e-4
  65.  
  66.       I find the single-line form easier to follow, but the above works just
  67.    as well. Note that numbers may be put in integer, floating point or
  68.    scientific notation. Names may NOT begin with a number(very important).
  69.       Note that it is not just miles, but either statute_miles or
  70.    nautical_miles. The statute or nautical MUST be specified. In any case
  71.    where the program apparently fails, check conv.dat for proper spelling.
  72.  
  73.       Don't put spaces in names ( use '_' or '-' ) unless you enjoy using
  74.    double quotes around your strings. Remember, this would also require
  75.    double quotes when Convert was used and when the corresponing names were
  76.    put into conv.dat.
  77.  
  78.       Probably the hardest thing to do right is the numerical
  79.    correspondences. Make sure they are 'pointing the right way' as well as
  80.    being the right number. The first number in a category is always 1(one),
  81.    and all the rest are relative to that unit. Hint: if the largest unit is
  82.    put first, all the others will be > 1. Another way to think of it is that
  83.    the number below an item is the number of that item in the first item
  84.    ( i.e. if the item is smaller than the first, its multiplier will be
  85.    larger than one. ). I didn't do that with the supplied conv.dat as you
  86.    may have noticed - Too soon old und too late schmart!
  87.  
  88.       Note: Some items below appear twice, once as you would expect, and
  89.    again with a trailing '*' to indicate a second category. An example of
  90.    this is pound and pound* to denote respectively mass and force. Their
  91.    synonyms are lb and lb*. Some units in conv.dat may look strangely
  92.    spelled, i.e. pars for parsec. This is because the synonym converter
  93.    replaces 'sec' with 's'. This was intended for things quite different,
  94.    but once there, this action must be accounted for.
  95.  
  96.     Item            Synonym
  97.    barrel             bbl
  98.    calorie            cal
  99.    celsius            c
  100.    centi              c
  101.    century            cent
  102.    centurie           cent
  103.    circular           cir
  104.    cubic              cu
  105.    day                dy
  106.    decade             dec
  107.    degree             deg
  108.    electron           e
  109.    pound*             lb*
  110.    fahrenheit         f
  111.    feet               ft
  112.    foot               ft
  113.    gallon             gal
  114.    gram               g
  115.    horsepower         hp
  116.    hour               hr
  117.    inche              in
  118.    inch               in
  119.    kilo               k
  120.    knot               kt
  121.    liter              l
  122.    litre              l
  123.    mercury            hg
  124.    meter              m
  125.    metre              m
  126.    mega               m
  127.    micro              u
  128.    mile               mi
  129.    milli              m
  130.    minute*            min*
  131.    month              mo
  132.    newton             n
  133.    ounce              oz
  134.    pound              lb
  135.    radian             rad
  136.    revolution         rev
  137.    minute             min
  138.    second*            s*
  139.    second             s
  140.    square             sq
  141.    volt               v
  142.    water              h2o
  143.    watt               w
  144.    yard               yd
  145.    year               yr
  146.    sec*               s*
  147.    sec                s
  148.  
  149.       As can be seen, Items can have the same synonym. However the reverse
  150.    is not true.
  151.  
  152.    History
  153.    -------
  154.       Covvert was inspired by Units( by Gregory Simpson ) but I wanted a
  155.    program that was easier to use and could be customized by changing the
  156.    data file ( conv.dat ) alone and would not require re-compilation of the
  157.    program. Consquently, I used nothing from Units but the idea of converting
  158.    from one unit to another.
  159.  
  160.       Another wish was to be able to use full names of units or plurals if
  161.    desired without having to use them in the data file.
  162.  
  163.       Compiled with DICE v2.06.39. This version: 1.3 - 1/21/93
  164.  
  165.  
  166.       David Whitmore
  167.       32 Oakridge Ave.
  168.       Natick, MA 01760
  169.  
  170.       Sorry, I don't have an address on any bulletin boards, only USnail :-)
  171.  
  172.